Repository navigation
Resolve admins room for task reports in #admins room for call scheduling - #86434
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@carlosmiceli Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| const reportID = route.params?.reportID; | ||
|
|
||
| const [adminReportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`, { | ||
| const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); |
There was a problem hiding this comment.
❌ PERF-11 (docs)
The two new useOnyx subscriptions for report and parentReport subscribe to entire Report objects without selectors. Report objects can be large with many fields, but this component only needs type and parentReportID from report, and chatType and reportID from parentReport. Any change to unrelated fields on these reports (e.g., lastVisibleActionCreated, stateNum, etc.) will trigger unnecessary re-renders of this component.
Add selectors to narrow the subscriptions to only the fields needed:
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {
selector: (data) => ({
type: data?.type,
parentReportID: data?.parentReportID,
}),
});
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`, {
selector: (data) => ({
chatType: data?.chatType,
reportID: data?.reportID,
}),
});This ensures deepEqual runs on a tiny object (2 fields) rather than the full Report, and the component only re-renders when the fields it actually uses change.
Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
There was a problem hiding this comment.
Ah this violates functions call for TS error, so going to leave it as it is
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bb905f0a9a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return () => { | ||
| sendScheduleCallNudge(session?.accountID ?? CONST.DEFAULT_NUMBER_ID, reportID); | ||
| sendScheduleCallNudge(session?.accountID ?? CONST.DEFAULT_NUMBER_ID, adminsRoomReportID); | ||
| }; | ||
| // eslint-disable-next-line react-hooks/exhaustive-deps | ||
| }, []); |
There was a problem hiding this comment.
Track admins room ID in unmount nudge effect
The cleanup effect is intentionally frozen with [], so it captures the initial adminsRoomReportID only. In task-report flows, that value can start as the task ID and later switch to the parent #admins report after Onyx data arrives; when the page unmounts, sendScheduleCallNudge may still be sent to the stale task report. This means the new parent-report routing logic is skipped in cold-start/deep-link cases and the nudge can target the wrong conversation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I think it's an edge case. I would like to leave it as its unless we see real issue.
|
Is this ready to review @MonilBhavsar ? |
|
Yes 👍 |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 @carlosmiceli has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.3.50-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR against the help site articles under PR Summary: This is a bug fix that resolves the correct #admins room Help site articles reviewed:
Conclusion: No help site changes are required. This PR is purely an internal bug fix — it corrects which |
|
Hi @MonilBhavsar, can this PR be implemented on the native apps, or will testing on the web be enough? |
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.3.50-8 🚀
|
Explanation of Change
The backendAPI accepts #admins room.
The task report in #admins room has the
chatTypeispolicyAdmins, which is not a "real" admins room.For such rooms, resolve the real admins room from the parentReportID
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/600452
PROPOSAL:
Tests
Same as QA
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-03-26.at.7.05.45.PM.mov